import Taro from '@tarojs/taro'
import { prefix } from '../utils'

export function fetch() {
    return dispatch => {

        Taro.request({
            url: `${prefix}/api/v1/questions`,
            method: 'GET',
        })
        .then(results => {
            const { data = {} } = results || {}
            dispatch({
                type: 'questions/fetch',
                payload: { data }
            })
        })

    }
}